package com.lukk.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lukk.service.IGoodService;

/**
 * 
 * GoodController 下午1:19:00 Copyright zhaocj Inc. All Rights reserved.
 * alldios@outlook.com
 *
 */
@Controller
@RequestMapping("/good")
public class GoodController {
	private static Logger logger = LogManager.getLogger(GoodController.class.getName());
	@Resource
	private IGoodService goodService;

	/**
	 * 
	 * @param offset
	 * @param limit
	 * @param sort
	 * @param order
	 * @param indentID
	 * @param session
	 * @return
	 */
	@RequestMapping("/queryIndentProductGoodPartsByIndent")
	public @ResponseBody Map<String, Object> queryIndentProductGoodPartsByIndent(Integer offset, Integer limit,
			String sort, String order, Integer indentID, HttpSession session) {
		logger.debug("传入的参数对象是{},{},{},{},{}", offset, limit, sort, order, indentID);
		Map<String, Object> retMap = null;
		try {
			retMap = goodService.selectIndentProductGoodPartsByIndent(offset, limit, sort, order, indentID, session);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return retMap;
	}

	/**
	 * 
	 * @param offset
	 * @param limit
	 * @param sort
	 * @param order
	 * @param indentID
	 * @param session
	 * @return
	 */
	@RequestMapping("/queryIndentClothGoodPartsByIndent")
	public @ResponseBody Map<String, Object> queryIndentClothGoodPartsByIndent(Integer offset, Integer limit,
			String sort, String order, Integer indentID, HttpSession session) {
		logger.debug("传入的参数对象是{},{},{},{},{}", offset, limit, sort, order, indentID);
		Map<String, Object> retMap = null;
		try {
			retMap = goodService.selectIndentClothGoodPartsByIndent(offset, limit, sort, order, indentID, session);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return retMap;
	}
}
